package cn.pku.sirx.snad.uias.service.impl;

import cn.pku.sirx.snad.ad.service.IUserInfluenceService;
import cn.pku.sirx.snad.uias.analyzer.IAnalyzer;

/**
 * @author WangXiao
 */
public class UserInfluenceServiceImpl implements IUserInfluenceService {

	@Override
	public double getUserInfluence(String fromUserId, String toUserId) {
		if (fromUserId == null || toUserId == null) {
			return .0; // keep max compatibility
		}
		return userInfluenceAnalyzer.analyze(fromUserId, toUserId);
	}

	private IAnalyzer userInfluenceAnalyzer;

	public void setUserInfluenceAnalyzer(IAnalyzer userInfluenceAnalyzer) {
		this.userInfluenceAnalyzer = userInfluenceAnalyzer;
	}

}
